import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { LocationDataVO, LocationDataForm, LocationDataQuery } from '@/api/system/locationData/types';

/**
 * 查询人员定位列表
 * @param query
 * @returns {*}
 */

export const listLocationData = (query?: LocationDataQuery): AxiosPromise<LocationDataVO[]> => {
  return request({
    url: '/system/locationData/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询人员定位详细
 * @param id
 */
export const getLocationData = (id: string | number): AxiosPromise<LocationDataVO> => {
  return request({
    url: '/system/locationData/' + id,
    method: 'get'
  });
};

/**
 * 新增人员定位
 * @param data
 */
export const addLocationData = (data: LocationDataForm) => {
  return request({
    url: '/system/locationData',
    method: 'post',
    data: data
  });
};

/**
 * 修改人员定位
 * @param data
 */
export const updateLocationData = (data: LocationDataForm) => {
  return request({
    url: '/system/locationData',
    method: 'put',
    data: data
  });
};

/**
 * 删除人员定位
 * @param id
 */
export const delLocationData = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/locationData/' + id,
    method: 'delete'
  });
};
